package test;

public class T8 {

	/**
	 * 解体思路
	 * An = 1/[n*(n+1)] = 1/n - 1/(n+1)
	 * 所以数列 Sn = 1 - 1/(n+1)
	 * 
	 * 保证变化小于 0.01 则 An <0.01 
	 * 我们求n是多少就行了
	 */
	private static void solution() {
		double n = 0;
		double An;
		// 由An<0.01确定n
		do {
			n++;
			An = 1/n - 1/(n+1);
		} while (An>=0.01);
		double Sn = 1 - 1/(n+1);
		System.out.println(Sn);
	}
	
	public static void main(String[] args) {
		solution();
	}
}
